package com.btm.distrb.model;

public class Column {

    private Table table;
    /**
     * 数据库字段名
     */
    private String columnName;
    /**
     * 数据库字段类型
     */
    private int columnType;
    /**
     * 字段注释
     */
    private String columnAnnotation;

    public String getColumnName() {
        return columnName;
    }

    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }

    public int getColumnType() {
        return columnType;
    }

    public void setColumnType(int columnType) {
        this.columnType = columnType;
    }

    public String getColumnAnnotation() {
        return columnAnnotation;
    }

    public void setColumnAnnotation(String columnAnnotation) {
        this.columnAnnotation = columnAnnotation;
    }

    public Table getTable() {
        return table;
    }

    public void setTable(Table table) {
        this.table = table;
    }

    @Override
    public boolean equals(Object obj) {
        if (null == obj) {
            return false;
        }
        if (obj == this){
            return true;
        }
        if (obj instanceof Column) {
            Column column = (Column) obj;
            return column.getColumnName().equals(this.columnName) &&
                    column.getColumnType() == this.getColumnType();
        } else {
            return false;
        }
    }
}
